﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PucLib;

namespace Pucmatico
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }


        private void listaRamos_SelectedIndexChanged(object sender, EventArgs e)
        {
            listaSeccion.Items.Clear();
            Ramo r = listaRamos.SelectedItem as Ramo;
            listaSeccion.Items.AddRange(r.Secciones.ToArray());
            listaSeccion.Refresh();
        }

        private void cargarRamosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                listaRamos.Items.Clear();
                String s = folderBrowserDialog1.SelectedPath;

                PucLib.Control con = new PucLib.Control();

                con.CargarRamos(s);

                listaRamos.Items.AddRange(con.GetRamos().ToArray());
                listaRamos.Refresh();
            }
        }

        private void salirToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        
    }
}
